{"ast":null,"code":"import _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nvar _excluded = [\"actions\", \"children\", \"defaultValue\", \"name\", \"onChange\", \"value\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport FormGroup from '../FormGroup';\nimport useForkRef from '../utils/useForkRef';\nimport useControlled from '../utils/useControlled';\nimport RadioGroupContext from './RadioGroupContext';\nimport useId from '../utils/useId';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {\n  var actions = props.actions,\n    children = props.children,\n    defaultValue = props.defaultValue,\n    nameProp = props.name,\n    _onChange = props.onChange,\n    valueProp = props.value,\n    other = _objectWithoutPropertiesLoose(props, _excluded);\n  var rootRef = React.useRef(null);\n  var _useControlled = useControlled({\n      controlled: valueProp,\n      default: defaultValue,\n      name: 'RadioGroup'\n    }),\n    _useControlled2 = _slicedToArray(_useControlled, 2),\n    value = _useControlled2[0],\n    setValueState = _useControlled2[1];\n  React.useImperativeHandle(actions, function () {\n    return {\n      focus: function focus() {\n        var input = rootRef.current.querySelector('input:not(:disabled):checked');\n        if (!input) {\n          input = rootRef.current.querySelector('input:not(:disabled)');\n        }\n        if (input) {\n          input.focus();\n        }\n      }\n    };\n  }, []);\n  var handleRef = useForkRef(ref, rootRef);\n  var name = useId(nameProp);\n  var contextValue = React.useMemo(function () {\n    return {\n      name: name,\n      onChange: function onChange(event) {\n        setValueState(event.target.value);\n        if (_onChange) {\n          _onChange(event, event.target.value);\n        }\n      },\n      value: value\n    };\n  }, [name, _onChange, setValueState, value]);\n  return /*#__PURE__*/_jsx(RadioGroupContext.Provider, {\n    value: contextValue,\n    children: /*#__PURE__*/_jsx(FormGroup, _extends({\n      role: \"radiogroup\",\n      ref: handleRef\n    }, other, {\n      children: children\n    }))\n  });\n});\nprocess.env.NODE_ENV !== \"production\" ? RadioGroup.propTypes /* remove-proptypes */ = {\n  // ----------------------------- Warning --------------------------------\n  // | These PropTypes are generated from the TypeScript type definitions |\n  // |     To update them edit the d.ts file and run \"yarn proptypes\"     |\n  // ----------------------------------------------------------------------\n  /**\n   * The content of the component.\n   */\n  children: PropTypes.node,\n  /**\n   * The default value. Use when the component is not controlled.\n   */\n  defaultValue: PropTypes.any,\n  /**\n   * The name used to reference the value of the control.\n   * If you don't provide this prop, it falls back to a randomly generated name.\n   */\n  name: PropTypes.string,\n  /**\n   * Callback fired when a radio button is selected.\n   *\n   * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.\n   * @param {string} value The value of the selected radio button.\n   * You can pull out the new value by accessing `event.target.value` (string).\n   */\n  onChange: PropTypes.func,\n  /**\n   * Value of the selected radio button. The DOM API casts this to a string.\n   */\n  value: PropTypes.any\n} : void 0;\nexport default RadioGroup;","map":{"version":3,"names":["_extends","_objectWithoutPropertiesLoose","_excluded","React","PropTypes","FormGroup","useForkRef","useControlled","RadioGroupContext","useId","jsx","_jsx","RadioGroup","forwardRef","props","ref","actions","children","defaultValue","nameProp","name","onChange","valueProp","value","other","rootRef","useRef","controlled","default","setValueState","useImperativeHandle","focus","input","current","querySelector","handleRef","contextValue","useMemo","event","target","Provider","role","process","env","NODE_ENV","propTypes","node","any","string","func"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@mui/material/esm/RadioGroup/RadioGroup.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"actions\", \"children\", \"defaultValue\", \"name\", \"onChange\", \"value\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport FormGroup from '../FormGroup';\nimport useForkRef from '../utils/useForkRef';\nimport useControlled from '../utils/useControlled';\nimport RadioGroupContext from './RadioGroupContext';\nimport useId from '../utils/useId';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {\n  const {\n      // private\n      // eslint-disable-next-line react/prop-types\n      actions,\n      children,\n      defaultValue,\n      name: nameProp,\n      onChange,\n      value: valueProp\n    } = props,\n    other = _objectWithoutPropertiesLoose(props, _excluded);\n  const rootRef = React.useRef(null);\n  const [value, setValueState] = useControlled({\n    controlled: valueProp,\n    default: defaultValue,\n    name: 'RadioGroup'\n  });\n  React.useImperativeHandle(actions, () => ({\n    focus: () => {\n      let input = rootRef.current.querySelector('input:not(:disabled):checked');\n      if (!input) {\n        input = rootRef.current.querySelector('input:not(:disabled)');\n      }\n      if (input) {\n        input.focus();\n      }\n    }\n  }), []);\n  const handleRef = useForkRef(ref, rootRef);\n  const name = useId(nameProp);\n  const contextValue = React.useMemo(() => ({\n    name,\n    onChange(event) {\n      setValueState(event.target.value);\n      if (onChange) {\n        onChange(event, event.target.value);\n      }\n    },\n    value\n  }), [name, onChange, setValueState, value]);\n  return /*#__PURE__*/_jsx(RadioGroupContext.Provider, {\n    value: contextValue,\n    children: /*#__PURE__*/_jsx(FormGroup, _extends({\n      role: \"radiogroup\",\n      ref: handleRef\n    }, other, {\n      children: children\n    }))\n  });\n});\nprocess.env.NODE_ENV !== \"production\" ? RadioGroup.propTypes /* remove-proptypes */ = {\n  // ----------------------------- Warning --------------------------------\n  // | These PropTypes are generated from the TypeScript type definitions |\n  // |     To update them edit the d.ts file and run \"yarn proptypes\"     |\n  // ----------------------------------------------------------------------\n  /**\n   * The content of the component.\n   */\n  children: PropTypes.node,\n  /**\n   * The default value. Use when the component is not controlled.\n   */\n  defaultValue: PropTypes.any,\n  /**\n   * The name used to reference the value of the control.\n   * If you don't provide this prop, it falls back to a randomly generated name.\n   */\n  name: PropTypes.string,\n  /**\n   * Callback fired when a radio button is selected.\n   *\n   * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.\n   * @param {string} value The value of the selected radio button.\n   * You can pull out the new value by accessing `event.target.value` (string).\n   */\n  onChange: PropTypes.func,\n  /**\n   * Value of the selected radio button. The DOM API casts this to a string.\n   */\n  value: PropTypes.any\n} : void 0;\nexport default RadioGroup;"],"mappings":";AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,6BAA6B,MAAM,yDAAyD;AACnG,IAAMC,SAAS,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC;AACtF,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,aAAa,MAAM,wBAAwB;AAClD,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,KAAK,MAAM,gBAAgB;AAClC,SAASC,GAAG,IAAIC,IAAI,QAAQ,mBAAmB;AAC/C,IAAMC,UAAU,GAAG,aAAaT,KAAK,CAACU,UAAU,CAAC,SAASD,UAAU,CAACE,KAAK,EAAEC,GAAG,EAAE;EAC/E,IAGIC,OAAO,GAMLF,KAAK,CANPE,OAAO;IACPC,QAAQ,GAKNH,KAAK,CALPG,QAAQ;IACRC,YAAY,GAIVJ,KAAK,CAJPI,YAAY;IACNC,QAAQ,GAGZL,KAAK,CAHPM,IAAI;IACJC,SAAQ,GAENP,KAAK,CAFPO,QAAQ;IACDC,SAAS,GACdR,KAAK,CADPS,KAAK;IAEPC,KAAK,GAAGvB,6BAA6B,CAACa,KAAK,EAAEZ,SAAS,CAAC;EACzD,IAAMuB,OAAO,GAAGtB,KAAK,CAACuB,MAAM,CAAC,IAAI,CAAC;EAClC,qBAA+BnB,aAAa,CAAC;MAC3CoB,UAAU,EAAEL,SAAS;MACrBM,OAAO,EAAEV,YAAY;MACrBE,IAAI,EAAE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